<?php
Class MySqlCon
{
    protected $host = "localhost";
    protected $user = "root";
    protected $pass = "123456";
    protected $dbname = "test";
    protected $con = "";
 
    public function __construct()
    {
        $this->con = mysql_connect("$this->host" , "$this->user" , "$this->pass") or die ('Error');
        mysql_select_db("$this->dbname");
    }
 
    public function close()
    {
        mysql_close($this->con);
    }
}
?>
